Security News
CISA Brings KEV Data to GitHub
CISA's KEV data is now on GitHub, offering easier access, API integration, commit history tracking, and automated updates for security teams and researchers.
@jalik/extend
Advanced tools
A utility to merge objects.
Useful when you need to merge two or more objects into one.
This library is tested with unit tests.
In this example, all objects are merged into the first object, so the first object is modified, if you don't want to modify the object, pass en empty object {}
as the first argument.
Note that objects are merged based on their order, so the 2nd object is merged in the first, then the 3rd is merged in the first, and so on... Keep in mind that first objects may be overridden by following objects.
import {extend} from "@jalik/extend";
const coldColors = {
blue: "#0000FF",
green: "#00FF00"
};
const hotColors = {
red: "#FF0000",
yellow: "#FFF000"
};
const customColors = {
cyan: "#5BF8FF",
pink: "#FF4CFB"
};
// Merge all colors in a new object
const mixedColors = extend({}, hotColors, coldColors, customColors);
In the previous example, all objects were flat, but it works also with deep objects and nested attributes.
import {extendRecursively} from "@jalik/extend";
const colorSet1 = {
cold: {
blue: "#0000FF",
green: "#00FF00"
},
hot: {
red: "#FF0000",
yellow: "#FFF000"
},
custom: {
cyan: "#5BF8FF",
pink: "#FF4CFB"
}
};
const colorSet2 = {
cold: {
blue: "#0011AA",
green: "#00AA11"
},
hot: {
red: "#AA0011",
yellow: "#AAA111"
}
};
// Merge all colors in a new object
const mixedColors = extendRecursively({}, colorSet1, colorSet2);
History of releases is in the changelog.
The code is released under the MIT License.
v1.0.3
FAQs
A utility to merge flat objects.
We found that @jalik/extend demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
CISA's KEV data is now on GitHub, offering easier access, API integration, commit history tracking, and automated updates for security teams and researchers.
Security News
Opengrep forks Semgrep to preserve open source SAST in response to controversial licensing changes.
Security News
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.